require.config({
    urlArgs: "v=3.3.80",
    baseUrl: "../lib",
    paths: {
        jquery: "jquery-1.11.1.min",
        bootstrap: "../lib/bootstrap/bootstrap.min",
        bsie: "bsie/bootstrap-ie",
        handlebars: "../javascript/handlebars.runtime-v1.3.0.min",
        echarts: "echarts/echarts",
        "echarts/chart/line": "echarts/echarts",
        "echarts/chart/pie": "echarts/echarts",
        "echarts/chart/bar": "echarts/echarts",
        flexpaper: "flexpaper/js/flexpaper",
        flexpaper_handler: "flexpaper/js/flexpaper_handlers",
        jquery_extension: "flexpaper/js/jquery.extensions.min",
        jquery_ui: "jqueryui/jquery_ui.min",
        jquery_ui_touch: "jqueryui/jquery_ui_touch_punch.min",
        jquery_mobile: "jquerymobile/jquery.mobile-1.4.3.min",
        validate: "validate/jquery.validate",
        stickup: "stickup/stickUp.min",
        templates: "../javascript/wjs.templates",
        templates2: "../templates/wjs.templates.users",
        modules: "../dist/modules",
        jquery_fn_toastr: "../javascript/jquery_fn_toastr",
        jquery_fn: "../javascript/jquery_fn_wjs",
        api: "../javascript/wjs_api",
        loan: "../javascript/wjs_loan",
        persistent: "../dist/modules/wjs_persistent",
        city: "../dist/modules/jquery_fn_cityGangeds",
        lightbox: "../dist/modules/lightbox",
        app: "../dist/app"
    },
    shim: {
        jquery:{exports: "jquery"},
        handlebars: {exports: "handlebars"},
        bootstrap: {deps: ["jquery"], exports: "bootstrap"},
        flexpaper: {exports: "flexpaper"},
        flexpaper_handler: {exports: "flexpaper_handler"},
        templates: {deps: ["handlebars"], exports: "templates"},
        jquery_fn: {deps: ["jquery"], exports: "jquery_fn"},
        lightbox: {deps: ["jquery"], exports: "lightbox"},
        stickup: {deps: ["jquery"], exports: "stickup"},
        jquery_ui: {deps: ["jquery"], exports: "jquery_ui"},
        jquery_ui_touch: {deps: ["jquery", "jquery_ui"], exports: "jquery_ui_touch"},
        jquery_mobile: {deps: ["jquery"], exports: "jquery_mobile"},
        bsie: {deps: ["jquery"], exports: "bsie"},
        validate: {deps: ["jquery"], exports: "validate"},
        api: {deps: ["jquery", "jquery_fn"], exports: "api"},
        loan: {deps: ["jquery", "jquery_fn"], exports: "loan"},
        jquery_fn_toastr: {deps: ["jquery"], exports: "jquery_fn_toastr"},
        index:{deps:["jquery","api","loan"]}
    }
});
//require(["../javascript/config.js"], function () {
    require(["jquery", "bootstrap", "templates", "jquery_fn"], function (a) {
        function b(b, c, d, e) {
            var f = b(e);
            a(c).html(f), "function" == typeof d && d()
        }

        function c() {
            function b() {
                var b = a(window).height(), c = a("body").height();
                p.hasClass("fixed-bottom") && (c += 106), b > c ? p.addClass("fixed-bottom") : p.removeClass("fixed-bottom")
            }

            a("#footer_wrapper").append('<iframe name="myiframe" src="../template/aq_auth.html" style="display:none"></iframe>'), a(".service .div_ser").click(function () {
                a(".service").toggleClass("exp")
            }), a(".service .ser2").click(function () {
                a(".service").toggleClass("exp-weixin")
            }), a(".fm-item-qq").click(function () {
                var b = "http://wpa.b.qq.com/cgi/wpa.php?key=XzkzODAyMzM0NV8xNTIwMzdfNDAwODc4MjcyN18";
                require([b], function () {
                    var b = setInterval(function () {
                        a("iframe").length >= 2 && (clearInterval(b), a("#launchBtn", document.getElementsByTagName("iframe")[2].contentWindow.document).click())
                    }, 300)
                })
            }), a(".fm-item-top").click(function () {
                a("html,body").animate({scrollTop: "0px"}, 300)
            }), a(document).scroll(function () {
                a(this).scrollTop() > 100 ? a(".fm-item-top").show().css("display", "block") : a(".fm-item-top").fadeOut()
            }), a(".hc-o").hover(function () {
                var b = a(this).attr("src");
                a(this).attr("src", b.replace(/\.jpg/, "_o.jpg"))
            }, function () {
                var b = a(this).attr("src");
                a(this).attr("src", b.replace(/_o\.jpg/, ".jpg"))
            }), a(".png-o").hover(function () {
                var b = a(this).attr("src");
                a(this).attr("src", b.replace(/\.png/, "_o.png"))
            }, function () {
                var b = a(this).attr("src");
                a(this).attr("src", b.replace(/_o\.png/, ".png"))
            }), b(), a(document).ajaxComplete(function () {
                setTimeout(b, 200)
            })
        }

        function d() {
            var d = !!a.cookie("u"), e = a.cookie("ul"), h = d && e ? e.split("&") : [""], i = localStorage.getItem("orgType"), j = localStorage.getItem("investOrgSession"), k = localStorage.getItem("isHaveInsideLetter");
            if (s.prepend(t.html_head), m.size() && b(t.header, m, null, {
                    isLogin: d,
                    userName: h[1],
                    investOrgSession: j,
                    isHaveInsideLetter: k
                }), n.size() && b(t.nav, n, function () {
                }, {investOrgSession: j}), o.size() && b(t.mobile_nav, o, function () {
                    a("#quick_menu_but2").click(function () {
                        var b = a(document).height();
                        a("#quick_menu2 .info_menu").height(b + "px"), a("#quick_menu2:visible").size() ? a.hideMenu() : a.showMenu()
                    })
                }, {
                    isLogin: d,
                    updateVip: "2" != h[4],
                    userName: h[1],
                    headPic: h[7]
                }), p.size() && b(t.footer, p, c), d) {
                var e = a.cookie("ul"), h = e.split("&"), l = {
                    userName: h[1],
                    isVip: "0" == h[4],
                    isAuth: "2" == h[5],
                    hasPhone: !!h[2],
                    hasMail: !!h[3],
                    debitResale: h[8] ? a.inArray("1001", h[8].split(",")) >= 0 : !1,
                    claims: h[8] ? a.inArray("1004", h[8].split(",")) >= 0 : !1,
                    debitTransfer: "549" == h[0],
                    isDebit: "2" == h[9],
                    headPic: h[7],
                    orgType: i,
                    investOrgSession: j
                };
                l.debitResale && a(".debit-resale").css("display", "table-cell"), l.debitTransfer && a(".debit-transfer").css("display", "table-cell"), l.isVip ? a(".set-vip").html('<a href="/user/setting-upgrade.html">申请成为VIP</a>').css("display", "table-cell").show() : a(".set-vip").html('<a href="/user/setting-upgrade2.html">我的VIP权益</a>').css("display", "table-cell").show();
                var u = 30 + (l.isAuth ? 30 : 0) + (l.hasPhone ? 20 : 0) + (l.hasMail ? 20 : 0), v = 100 == u ? "强" : u >= 80 ? "高" : u >= 50 ? "中" : "低";
                l.safeRate = u, l.safeText = v, q.size() && b(t.user_header, q, g, l), r.size() && b(t.user_nav, r, f, l), globalUserSession = a.cookie("u")
            }
        }

        function e() {
            var b = window.location.href, c = b.replace("http://", "").split("/"), d = 10;
            switch (c[1]) {
                case"loan":
                    d = 1;
                    break;
                case"persistent":
                    d = 1;
                    break;
                case"debit":
                    d = 2;
                    break;
                case"about":
                    d = 3;
                    break;
                case"help":
                    d = 4;
                    break;
                case"news":
                    d = 5;
                    break;
                case"user":
                    d = 0;
                    break;
                default:
                    d = 10
            }
            a("#wjs-nav-list li").removeClass("active").eq(d).addClass("active")
        }

        function f() {
            a(".user-set a").tooltip();
            var b = window.location.href, c = "01";
            a.each([{index: "01", reg: "account"}, {index: "07", reg: "invest-resale"}, {
                index: "02",
                reg: "invest"
            }, {index: "06", reg: "book"}, {index: "03", reg: "debit"}, {index: "03", reg: "persistent"}, {
                index: "03",
                reg: "draft"
            }, {index: "03", reg: "consume"}, {index: "08", reg: "setting-bank"}, {
                index: "04",
                reg: "setting"
            }, {index: "09", reg: "message"}, {index: "05", reg: "claims"}], function (a, d) {
                var e = new RegExp("/user/" + d.reg).test(b);
                return e ? (c = d.index, !1) : void 0
            }), a("#user_nav_wrapper .container li").removeClass("active").filter("[index=" + c + "]").addClass("active")
        }

        function g() {
            return !1
        }

        function h() {
            a("#show-qq-group").tooltip()
        }

        function i() {
            if ("1" == a.cookie("ie"))return !1;
            try {
                document.createElement("canvas").getContext("2d")
            } catch (b) {
                var c = window.location.href, d = /extension/;
                if (d.test(c))return !1;
                window.location.href = "/help/supports.html"
            }
        }

        function j() {
            !function () {
                var a = document.createElement("script");
                a.src = "//hm.baidu.com/hm.js?7e12c9021320586a9d79ce4410d42cc7";
                var b = document.createElement("script");
                b.src = "http://s4.cnzz.com/z_stat.php?id=1254114792&web_id=1254114792";
                var c = document.getElementsByTagName("script")[0];
                c.parentNode.insertBefore(b, c), c.parentNode.insertBefore(a, c)
            }()
        }

        function k() {
            if ("standalone"in window.navigator && window.navigator.standalone) {
                var a, b = !1;
                document.addEventListener("click", function (c) {
                    for (a = c.target; "A" !== a.nodeName && "HTML" !== a.nodeName;)a = a.parentNode;
                    "href"in a && -1 !== a.href.indexOf("http") && (-1 !== a.href.indexOf(document.location.host) || b) && (c.preventDefault(), document.location.href = a.href)
                }, !1)
            }
        }

        function l() {
            i(), d(), h(), e(), k(), j()
        }

        var m = a("#header_wrapper"), n = a("#nav_wrapper"), o = a("#mobile_nav_wrapper"), p = a("#footer_wrapper"), q = a("#user_header_wrapper"), r = a("#user_nav_wrapper"), s = a("head"), t = (require("templates"), {
            header: JIT["templates/header.htm"],
            nav: JIT["templates/nav.htm"],
            mobile_nav: JIT["templates/mobile_nav.htm"],
            footer: JIT["templates/footer.htm"],
            user_header: JIT["templates/user_header.htm"],
            user_nav: JIT["templates/user_nav.htm"],
            html_head: JIT["templates/html_head.htm"]
        });
        l()
    })
//});